package entity;

import java.util.ArrayList;
import java.util.List;

public class UserList {
	private List<User> males = new ArrayList<User>();
	private List<User> females = new ArrayList<User>();
	
	/**
	 *在使用<s:bean/>标签创建UserList对象时，初始化集合
	 */
	public UserList(){
		//初始化集合
		for(int i=1;i<5;i++){
			User e1 = new User();
			e1.setId(i);
			e1.setName("张三"+i);
			males.add(e1);
		}
		
		for(int i=5;i<10;i++){
			User e2 = new User();
			e2.setId(i);
			e2.setName("小红"+i);
			females.add(e2);
		}
	}
	
	public List<User> getFemales() {
		return females;
	}
	public void setFemales(List<User> females) {
		this.females = females;
	}
	public List<User> getMales() {
		return males;
	}
	public void setMales(List<User> males) {
		this.males = males;
	}

	@Override
	public String toString() {
		return "UserList [females=" + females + ", males=" + males + "]";
	}
	public static void main(String[] args) {
		System.out.println(new UserList());
	}
	
}
